package a2022.a20230106;

/**
 * @author lenovo
 * @date 2023/1/6
 */
public class a {
    public static void main(String[] args) {
        System.out.println(countEven(404));
    }

    public static int countEven(int num) {
        if ((num & 1) == 1) {
            return num >> 1;
        }
        int ans = num >> 1, sum = 0;
        while (num > 0) {
            sum += num % 10;
            num /= 10;
        }
        return ans + (sum & 1 ^ 1) - 1;
    }
}
